/**
 * Job Scheduling - MAGMA 2010 <br />
 * Author: Assaf Israel, IBM Research - Haifa <br />
 */
package logs;

import java.net.URL;

import org.apache.log4j.Logger;
import org.apache.log4j.PropertyConfigurator;

public class LogFactory {
  public static final String LOG_PROP_FILE = "log.properties";
  private static boolean configured = false;
  
  public synchronized static Logger getLog(final Class<?> _class) {
    if (!configured) {
      final URL resource = LogFactory.class.getResource(LOG_PROP_FILE);
      PropertyConfigurator.configure(resource);
      configured = true;
    }
    return Logger.getLogger(_class);
  }
}
